package com.sens.vo;

import android.os.Parcel;
import android.os.Parcelable;

import java.text.SimpleDateFormat;
import java.util.Date;

public class MybankOrderVo implements Parcelable {
    private long time;
    private String orderId;
    private double amount;
    private String currencyCode;
    private String tradeRemark;
    private String ownerName;
    private String ownerCardNo;
    private String tradeNo;
    private String tradeName;
    private String oppositeCardNo;
    private String oppositeName;
    private String payType = "支付宝";
    private String state = "交易成功";

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public double getAmount() {
        return amount;
    }

    public void setAmount(double amount) {
        this.amount = amount;
    }

    public String getCurrencyCode() {
        return currencyCode;
    }

    public void setCurrencyCode(String currencyCode) {
        this.currencyCode = currencyCode;
    }

    public String getTradeRemark() {
        return tradeRemark;
    }

    public void setTradeRemark(String tradeRemark) {
        this.tradeRemark = tradeRemark;
    }

    public String getOwnerName() {
        return ownerName;
    }

    public void setOwnerName(String ownerName) {
        this.ownerName = ownerName;
    }

    public String getOwnerCardNo() {
        return ownerCardNo;
    }

    public void setOwnerCardNo(String ownerCardNo) {
        this.ownerCardNo = ownerCardNo;
    }

    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    public String getTradeName() {
        return tradeName;
    }

    public void setTradeName(String tradeName) {
        this.tradeName = tradeName;
    }

    public String getOppositeCardNo() {
        return oppositeCardNo;
    }

    public void setOppositeCardNo(String oppositeCardNo) {
        this.oppositeCardNo = oppositeCardNo;
    }

    public String getOppositeName() {
        return oppositeName;
    }

    public void setOppositeName(String oppositeName) {
        this.oppositeName = oppositeName;
    }

    public String getPayType() {
        return payType;
    }

    public void setPayType(String payType) {
        this.payType = payType;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public static Creator<MybankOrderVo> getCREATOR() {
        return CREATOR;
    }

    @Override
    public String toString() {
        return "\n\t\ttime = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(time)) + ";" +
                "\n\t\torderId = " + orderId + ";" +
                "\n\t\tamount = " + amount + ";" +
                "\n\t\tstate = " + state + ";";
    }

    ////////////////////////////////////////////////////////////////////////////////////////////////
    public MybankOrderVo() {
    }

    protected MybankOrderVo(Parcel in) {
        time = in.readLong();
        orderId = in.readString();
        amount = in.readDouble();
        currencyCode = in.readString();
        tradeRemark = in.readString();
        ownerName = in.readString();
        ownerCardNo = in.readString();
        tradeNo = in.readString();
        tradeName = in.readString();
        oppositeCardNo = in.readString();
        oppositeName = in.readString();
        payType = in.readString();
        state = in.readString();
    }

    public static final Creator<MybankOrderVo> CREATOR = new Creator<MybankOrderVo>() {
        @Override
        public MybankOrderVo createFromParcel(Parcel in) {
            return new MybankOrderVo(in);
        }

        @Override
        public MybankOrderVo[] newArray(int size) {
            return new MybankOrderVo[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(time);
        dest.writeString(orderId);
        dest.writeDouble(amount);
        dest.writeString(currencyCode);
        dest.writeString(tradeRemark);
        dest.writeString(ownerName);
        dest.writeString(ownerCardNo);
        dest.writeString(tradeNo);
        dest.writeString(tradeName);
        dest.writeString(oppositeCardNo);
        dest.writeString(oppositeName);
        dest.writeString(payType);
        dest.writeString(state);
    }
}